﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:UMLSynthesizer.Tasks.View"
        xmlns:converters="clr-namespace:UMLSynthesizer.Tasks.View.Converters"
        x:Class="UMLSynthesizer.Tasks.View.SourceCodeSelectorWindow"
        x:ClassModifier="internal"
        Title="Select source code" WindowStartupLocation="CenterScreen"
        Height="185" Width="435" ResizeMode="NoResize" SizeToContent="Height">
    <Window.Resources>
        <converters:NBoolToVisibilityConverter x:Key="nBoolToVisibilityConverter"/>
    </Window.Resources>
    <Grid Margin="4">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid HorizontalAlignment="Left">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="90" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Content="Import" HorizontalAlignment="Right" />
            <StackPanel Orientation="Horizontal" Grid.Column="2" VerticalAlignment="Center">
                <RadioButton x:Name="ImportFileRadioButton" Content="File" Margin="5"
                             IsChecked="{Binding IsSourceOriginAFile, Mode=TwoWay}"/>
                <RadioButton x:Name="ImportDirectoryRadioButton" Content="Directory" Margin="5"
                             IsChecked="{Binding IsSourceOriginADirectory, Mode=TwoWay}"/>
            </StackPanel>
            <Label Content="Language" HorizontalAlignment="Right" Grid.Column="4"/>
            <ComboBox VerticalContentAlignment="Center" HorizontalAlignment="Left" Width="80" Grid.Column="6"
                      ItemsSource="{Binding AvailableLanguages}" SelectedValue="{Binding SelectedLanguage, Mode=TwoWay}"/>
        </Grid>
        <StackPanel Grid.Row="2">
            <local:ImportFileView Visibility="{Binding ElementName=ImportFileRadioButton, Path=IsChecked,
                Converter={StaticResource nBoolToVisibilityConverter}}" />
            <local:ImportDirectoryView Visibility="{Binding ElementName=ImportDirectoryRadioButton, Path=IsChecked,
                Converter={StaticResource nBoolToVisibilityConverter}}"/>
        </StackPanel>
        <Grid Grid.Row="4" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="30"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Button Content="_OK" Width="76" Command="{Binding StartScanAndCloseCommand}" IsDefault="True"/>
            <Button Content="_Cancel" Width="76" IsCancel="True" Command="{Binding CloseCommand}" Grid.Column="2"/>
        </Grid>
    </Grid>
</Window>
